package com.devin.service.impl;

import com.devin.model.entity.User;
import com.devin.repository.UserRepository;
import com.devin.repository.base.BaseRepository;
import com.devin.service.UserService;
import com.devin.service.base.AbstractCrudService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 *  
 *  @author devin
 *  @date 2020-04-14 19:06
 *  @version 1.0.2
*/

@Service
public class UserServiceImpl extends AbstractCrudService<User, Long> implements UserService  {



    private final UserRepository userRepository;

    protected UserServiceImpl(BaseRepository<User, Long> repository, UserRepository userRepository) {
        super(repository);
        this.userRepository = userRepository;
    }


    @Override
    public User getByUsername(String username) {
        return this.userRepository.findByUsername(username);
    }
}
